/*
 * @Author: HeAo
 * @Date: 2021-09-26 09:53:59
 * @LastEditTime: 2021-09-26 10:08:06
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2103code\3-1-ES6\day02\3-对象解构.js
 * 别乱动！
 */
// 对象结构，使用对象的简写形式（省略key，保留value对应的变量）
// let { name: username, age: userage } = { name: '张三', age: 12 }
// console.log(username, userage);

// 嵌套解构
// let obj = { p: ['Hello', { y: 'World' }] };
// let { p: [a, { y: b }] } = obj
// console.log(a + b);

// 对象结构-设置默认值
// let { name, age, gender = "male" } = { name: '张三', age: 12, gender: '男' }
// console.log(name, age, gender);

let obj1 = { a: 1, b: 2, c: 3 }
let { ...b } = obj1
console.log(b);
console.log(b === obj1);

